package edu.sctu.wangxiaoqiang.day20150614.iostream;

import java.io.*;

/**
 * Created by user25 on 2015/6/14.
 */
public class IOText {

    public void inputStream(){
        int count = 0;
        byte[] num= new byte[1024];
        try {
            FileInputStream fileInputStream = new FileInputStream(new File("D:Wildlife.wmv"));
            FileOutputStream fileOutputStream = new FileOutputStream(new File("D:Wildlife_1.wmv"));
            try {
                while ((count = fileInputStream.read(num))!=-1){
                    fileOutputStream.write(num,0,count);
                }
                System.out.println(count);
            } catch (IOException e) {
                e.printStackTrace();
            }
            try {
                fileOutputStream.close();
                fileInputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

    }

}
